package liczba;

import junit.framework.TestCase;
import org.junit.*;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.lang.Integer;
import java.lang.String;

public class LiczbaTest4 {
	Liczba liczba;
	String number;

	@Before
	public void setUp() {
		liczba = new Liczba( 100 );
	}

	@Test
	public void testConvert() {
		try {
			number = liczba.convert( 8 );
		}
		catch( NumberException e ) {
			return;
		}
		Assert.assertEquals( "144", number );
	}

	@Ignore
	public void testIgnored() {
		try {
			number = liczba.convert( 11 );
		}
		catch( NumberException e ) {
			return;
		}
		Assert.assertEquals( "1212", number );
	}

	@Test( timeout = 500 )
	public void testTimeout() {
		try {
			number = liczba.convert( 12 );
		}
		catch( NumberException e ) {
			return;
		}
		Assert.assertEquals( "84", number );
	}

	@Test( expected = NumberException.class )
	public void testExpected() throws NumberException {
			number = liczba.convert( 100 );
	}

	@After
	public void tearDown() {
		liczba = null;
	}
}